package org.binglan.youziyuepai.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.binglan.youziyuepai.entity.PersonalDynamic;
import com.baomidou.mybatisplus.extension.service.IService;
import org.binglan.youziyuepai.vo.DatePatVo;
import org.binglan.youziyuepai.vo.PageVo;

import java.util.List;

/**
 * <p>
 * 个人动态表 服务类
 * </p>
 *
 * @author sanjin
 * @since 2019-04-09
 */
public interface PersonalDynamicService extends IService<PersonalDynamic> {

    /**
     * 保存用户发布的约拍请求
     *
     * @param personalDynamic
     * @return
     */
    boolean savePersonalDynamic(PersonalDynamic personalDynamic, List<String> imageIds);


    List<PersonalDynamic> queryPersonalDynamicsByUserId(String userId);

    /**
     * 删除 动态
     *
     * @param personalDynamicId
     * @return
     */
    Boolean deletePersonalDynamicByPersonalDynamicId(String personalDynamicId, String userId);

    /**
     * 分页查询约拍信息
     * @param page
     * @param isAllow 是否经过审核
     * @param occupationId 约拍职业id
     * @return
     */
    PageVo<DatePatVo> queryDatePatByPage(Page page, Integer isAllow, Integer occupationId);

    /**
     * 查询总数
     */
    long queryCount(Integer isAllow);

    /**
     * 发起约拍申请
     * @param datePatId
     * @return
     */
    boolean sendDatePatApply(String userId, String datePatId, String reason);


    PersonalDynamic queryByPersonalDynamicId(String personalDynamicId);

}
